package com.example.demo.component.proxy.cglib.method;

import net.sf.cglib.proxy.MethodInterceptor;
import net.sf.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * @ClassName ConcreteClassInterceptor
 * @Description
 * @date 2023/4/6 13:39
 * @Author yanceysong
 * @Version 1.0
 */
public class ConcreteClassInterceptor implements MethodInterceptor {
    @Override
    public Object intercept(Object obj, Method method, Object[] arg, MethodProxy proxy) throws Throwable {
        System.out.println("Before:"+method);
        Object object=proxy.invokeSuper(obj, arg);
        System.out.println("After:"+method);
        return object;
    }
}
